<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');

/**
 * Class ProjectDetail
 */
class BDSLe extends Module
{
	/**
	 * Template
	 * @var string
	 */
	protected $strTemplate = 'mod_bds_le';


	/**
	 * Display a wildcard in the back end
	 * @return string
	 */
	public function generate()
	{
		return parent::generate();
	}

	/**
	 * Generate module
	 */
	protected function compile()
	{	
		$this->type = $this->Input->get("type") ? $this->Input->get("type") : 1;
		switch ($this->type) {
			case '1':
				$this->type_name = 'Cần bán';
				break;
			case '2':
				$this->type_name = 'Cần mua';
				break;
			case '3':
				$this->type_name = 'Cho thuê';
				break;
			case '4':
				$this->type_name = 'Cần thuê';
				break;
			default:
				$this->type = 1;
				$this->type_name = 'Cần bán';
				break;
		}
		$objBds  =$this->Database->execute("SELECT * FROM tl_bds WHERE published=1 AND type=".$this->type);
		$arrBds = $objBds->fetchAllAssoc();
		$this->Template->arrBds = $arrBds;
		$this->Template->type_name = $this->type_name;
		$this->Template->type= $this->type;
	}
}
?>